package com.yangle.frame.bizlogic.mapper;


import com.yangle.frame.MyMapper;
import com.yangle.frame.bizlogic.entity.Article;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ArticleMapper extends MyMapper<Article> {
/**
* 批量删除
*/
@Delete("<script> delete from article where id in "
+ "<foreach item='item' index='index' collection='ids' open='(' separator=',' close=')'>"
+ "#{item}"
+ "</foreach> </script>")
public void deletes(@Param("ids") List<String> ids);

//清除所有制定标记除自身
    @Update("update article set is_zd='false' where id!=#{id}")
    void updateAllZD(String id);
    }
